#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

typedef pair<int, int> PII;

const int N = 2010;
struct node{
	double x, y;
}coor[N];

int n;
int cnt;
vector<int> path;

void dfs(int begin)
{
	if(path.size() == 3)
	{
		int a = path[0], b = path[1], c = path[2];
		double x1 = coor[a].x, y1 = coor[a].y;
		double x2 = coor[b].x, y2 = coor[b].y;
		double x3 = coor[c].x, y3 = coor[c].y;
		double len1 = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
		double len2 = sqrt((x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3));
		double len3 = sqrt((x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2));
		if(len1 + len2 > len3 && len2 + len3 > len1 && len1 + len3 > len2)
		{
			if(fabs(len1 - len2) < len3 && fabs(len1 - len3) < len2 && fabs(len2 - len3) < len1)
			{
				if(len1 == len2 || len2 == len3 || len3 == len1) 
				{
					cnt++;
					for(auto x : path) cout << x << " ";
					cout << endl; 
				} 
			}
		}
		return;
	}
	for(int i = begin; i <= n; i++)
	{
		path.push_back(i);
		dfs(i + 1);
		path.pop_back();
	}
}

int main()
{
	cin >> n;
	for(int i = 1; i <= n; i++) cin >> coor[i].x >> coor[i].y;
	dfs(1);
	cout << cnt << endl;
	return 0;
}
